#ifndef CONTROLLER_2D_H_
#define CONTROLLER_2D_H_

#include <cmath>
#include <set>
#include "controller.h"
#include "model/curve_model.h"

class Controller2D : public Controller{
	private:
		static const float dragDistance = 0.02f;

	protected:
		std::pair<bool,Point>drag;

	public:
		Controller2D(View* view,Model* model);
		virtual ~Controller2D();


		virtual void mouseMotion(float x ,float y);
		virtual void mousePassiveMotion(float x ,float y){}

		virtual void mousePressed(int key,int state,float x ,float y);
		virtual void notifyViewportLeave();
		virtual void keyboard(unsigned char key,float x ,float y);

		virtual std::pair<bool,Point> startDrag(float x,float y);

		virtual void timer(int value);
	protected:
		void calculatePoints();
};

#endif /* CONTROLLER_2D_H_ */
